# BubbleSort
BubbleSort = [0, 19, 3, 5, 9, 4, 7, 1]
print(BubbleSort)

i = 0
while i < len(BubbleSort) - 1:
    j = 0
    while j < len(BubbleSort) - 1 - i:
        if BubbleSort[j] > BubbleSort[j + 1]:
            BubbleSort[j], BubbleSort[j + 1] = BubbleSort[j + 1], BubbleSort[j]  # list的交换数值
        j += 1
    i += 1

print(BubbleSort)
